home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / games / lorri4.zip / HEALER.SCR < prev    next >
Text File  |  1995-09-24  |  6KB  |  227 lines

  1. !
  2. ! Default Healer's Script
  3. !
  4. ! (c) DC Software, 1989-1995
  5. !
  6.  
  7. !------------------------------------------------------------------------!
  8. :@TALK ! Talk to the character !
  9. !------------------------------------------------------------------------!
  10.  
  11.   if player.hp = 0 then
  12.     writeln( player.name, " is dead!" );
  13.     STOP;
  14.   endif;
  15.  
  16.   if npc.picture >= 0 then
  17.     viewpcx(npc);
  18.   endif;
  19.  
  20.   loadtext( npc.text ); ! Get the NPC's text block !
  21.   loadvfl( npc.voice ); ! Get the NPC's voice block !
  22. ! First, say hello.. !
  23.  
  24.   if NPC.V0 > 0 then
  25.     writeln( "Hello ", player.name, ". What brings you back?" );
  26.   else
  27.     writeln( "Welcome to ", npc.name, ". How may I help you?" );
  28.   endif;
  29.  
  30. ! Now, set some variables..
  31.   NPC.V0 = 1; ! From know on, remember we've been here
  32.  
  33.   L0 = group.current;        ! Current spokesperson !
  34.   L4 = npc.value;            ! Cost of healing !
  35.   L5 = npc.value * 2;        ! Cost of Cures !
  36.   L6 = npc.value * 5;        ! Cost of resurections !
  37.   L7 = npc.value / 2 + 1;    ! Cost of removing cursed items !
  38.  
  39. :LOOP
  40.   group.current = L0;
  41.   L3 = select$( "Heal",          L4,
  42.                 "Cure",          L5,
  43.                 "Resurrect",     L6,
  44.                 "Remove Curse",  L7,
  45.                 "Talk",          -1  ! (talking is free)
  46.                );
  47.  
  48.   ON L3 GOTO DO_HEAL, DO_CURE, DO_RESTORE, CURSE, CHAT;
  49.  
  50. :CSTOP
  51.   writeln( "'Till we meet again.." );
  52.   goto XSTOP;
  53.  
  54. !
  55. ! Heal Wounds..
  56. !
  57. :DO_HEAL
  58.   writeln( "Heal who?" );
  59.   L3 = select( group );
  60.   IF L3 < 0 GOTO LOOP;
  61.  
  62.   if player.hp >= player.mhp then
  63.     writeln( player.name, " is not hurt.  You waste my time." );
  64.     goto LOOP;
  65.   endif;
  66.  
  67.   if player.hp = 0   GOTO DEADGUY;
  68.   if group.gold < L4 GOTO NOMONEY;
  69.  
  70.   writeln( player.name, " is now healed." );
  71.   voice( "OkSpell", 1000 );
  72.   dec( group.gold, L4 );
  73.   player.hp = player.mhp;  ! Reset the hit points to maximum hit points !
  74.   wait(0);
  75.   goto LOOP;
  76.  
  77.  
  78. !
  79. ! Cure poisoning...
  80. !
  81. :DO_CURE
  82.   writeln( "Cure whom?" );
  83.   L3 = select( group );
  84.   IF L3 < 0 GOTO LOOP;
  85.  
  86.   if player.hp = 0           GOTO DEADGUY;
  87.  
  88.   if NOT player.poisoned then
  89.     writeln( player.name, " is not poisoned.  You waste my time." );
  90.     goto LOOP;
  91.   endif;
  92.  
  93.   if group.gold < L5         GOTO NOMONEY;
  94.  
  95.   writeln( player.name, " is now cured." );
  96.   voice( "OkSpell", 1000 );
  97.   dec( group.gold, L5 );
  98.   player.poisoned = 0;
  99.   wait(0);
  100.   goto LOOP;
  101.  
  102. !
  103. ! Remove Cursed Item..
  104. !
  105. :CURSE
  106.   writeln( "Who has the cursed item?" );
  107.   L3 = select( group );
  108.   IF L3 < 0 GOTO LOOP;
  109.  
  110.   writeln( "Remove what item?" );
  111.   L3 = select( player.body );
  112.   if L3 < 0 goto LOOP;
  113.  
  114.   if curritem.cursed then
  115.     if group.gold <  L6 GOTO NOMONEY;
  116.     dec( group.gold, L6 );
  117.     writeln( "The ", curritem.type, " has been removed." );
  118.     voice( "OkSpell", 1000 );
  119.     move( curritem, player );
  120.   else
  121.     writeln( "The ", curritem.name, " is not cursed." );
  122.   endif;
  123.   wait(0);
  124.   goto LOOP;
  125. !
  126. ! or, if you so wish, you can handle each type separately..
  127. !
  128. !  on L3 goto :Weapon, :Armor, :Shield, :Ring, :Amulet, :Staff;
  129. !  goto LOOP;
  130. !  :Weapon move( player.weapon, player ); goto LOOP;
  131. !  :Armor  move( player.armor , player ); goto LOOP;
  132. !  :Shield move( player.shield, player ); goto LOOP;
  133. !  :Ring   move( player.ring  , player ); goto LOOP;
  134. !  :Amulet move( player.amulet, player ); goto LOOP;
  135. !  :Staff  move( player.staff , player ); goto LOOP;
  136.  
  137. !
  138. ! Resurect the dead..
  139. !
  140. :DO_RESTORE
  141.   writeln( "Resurrect who?" );
  142.   L3 = select( group );
  143.   IF L3 < 0 GOTO LOOP;
  144.  
  145.   if player.hp <> 0 then
  146.     writeln( player.name, " is not dead.  You waste my time." );
  147.     goto LOOP;
  148.   endif;
  149.  
  150.   if group.gold < L7 GOTO NOMONEY;
  151.  
  152.   voice( "HighWind", 1000 );
  153.   writeln( "First, the healer treats the dead body of ", player.name );
  154.   writeln( "treating every wound.  Then he replaces the blood in the body" );
  155.   writeln( "with a clear substance.  Finally a resurrection spell brings" );
  156.   writeln( "your friend to life." );
  157.   wait(0);
  158.   voice( "Thunder", 1000 );
  159.   wait(0);
  160.   voice( "WakeCall", 1000 );
  161.  
  162.   player.poisoned = 0;
  163.   player.hp       = player.mhp;
  164.   dec( group.gold, L7 );
  165.  
  166.   wait(0);
  167.   goto LOOP;
  168.  
  169. :DEADGUY
  170.   voice( "Dead" );
  171.   writeln( "Dr McCoy: He's dead Jim.." );
  172.   wait(0);
  173.   goto LOOP;
  174.  
  175. :NOMONEY
  176.   voice( "Broke" );
  177.   writeln( "Sorry, you can't afford it." );
  178.   wait(0);
  179.   goto LOOP;
  180.  
  181. !
  182. ! Handle conversation..
  183. !
  184. :CHAT
  185.   writeln( "What would you like to talk about?" );
  186.  
  187. :CHAT1
  188.   L3 = getstr("Name","Heal","Cure","Resurrec","Remove","Curse","Join","Bye");
  189.   if L3 = -1 then 
  190.     writeln( "Ok." );
  191.     goto LOOP; ! Pressed ESCape !
  192.   endif;
  193.  
  194. ! First, see if the keyword typed is in the character's text block !
  195.   if dotext( S0 ) then
  196.     if L3 = 7 goto XSTOP;
  197.     goto CHAT1;
  198.   endif;
  199.  
  200. ! It didn't, so try the predefined ones..
  201.   on L3 goto CName, DO_HEAL, DO_CURE, DO_RESTORE, CURSE, CURSE, JOINP, CSTOP;
  202.  
  203. ! Nope, try a 'DEFAULT' line
  204.   if not dotext( "DEFAULT" ) then
  205.     writeln( "I don't know anything about that!" );
  206.   endif;
  207.   goto CHAT1;
  208.  
  209. :CName
  210.   writeln( "My name is ", npc.name, "."        );
  211.   goto CHAT1;
  212.  
  213. :JOINP
  214.   writeln( "Sorry.  I'm dedicated to my patients.." );
  215.   goto CHAT1;
  216.  
  217. !-----------------------------------------------------------------!
  218. ! All STOPs now lead here so the screen can be restored if needed !
  219. !-----------------------------------------------------------------!
  220. :XSTOP
  221.   if npc.picture >= 0 then
  222.     paint(window); ! Assumes the picture fits in the window !
  223.   endif;
  224.   stats(-1); ! Refresh Statistics !
  225.   STOP;
  226.  
  227.